
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.PlanTeachingPersonDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class PlanTeachingPersonDaoJdbc extends BaseDaoJdbc implements PlanTeachingPersonDao {
	String tableName="T_PLAN_TEACHING_PERSON";
	String beanName="planTeachingPerson";
	
	public CommonBean createPlanTeachingPerson(){
		CommonBean planTeachingPersons=this.createBean(tableName,beanName);
                return planTeachingPersons;		
	}
	
/*
	public CommonBean findPlanTeachingPersons(String refid) {
		CommonBean planTeachingPersons=this.createPlanTeachingPerson();
		String sql="select * from T_PLAN_TEACHING_PERSON where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		planTeachingPersons.addData(data);
                return planTeachingPersons;
       }
*/
	public CommonBean findPlanTeachingPersonById(String id) {
		CommonBean planTeachingPersons=this.createPlanTeachingPerson();
		String sql="select * from T_PLAN_TEACHING_PERSON where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		planTeachingPersons.addData(data);
    return planTeachingPersons;
  }
  
	public CommonBean findAllPlanTeachingPersons() {
		CommonBean planTeachingPersons=this.createPlanTeachingPerson();
		String sql="select * from T_PLAN_TEACHING_PERSON ";
		List data=this.getCommonDao().select(sql,new String[]{});
		planTeachingPersons.addData(data);
    return planTeachingPersons;
  }
	public void insertPlanTeachingPerson(CommonBean planTeachingPersonBean){
		List data=planTeachingPersonBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
	public void updatePlanTeachingPerson(CommonBean planTeachingPersonBean){
		List data=planTeachingPersonBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchUpdate(row,data);
	}
}

